package com.chen.q2.xml;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 启动类
 * 注解方式装配Bean
 */
@SpringBootApplication
public class Application {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("context1.xml");

        Student student = (Student) context.getBean("student01");
        System.out.println(student);

        //自定义标签加载student
        Student student1 = (Student) context.getBean("102");
        System.out.println(student1);
    }

}
